@echo off

: CODE DRAFT #1
:C:\FOSS\GNU32\GetGnuWin32\bin\sed "s/ $ /;/g" c:\LAFDCWEB_pre-01.TXT > c:\LAFDCWEB_pre-02.txt
:C:\FOSS\GNU32\GetGnuWin32\bin\sed "s/;/';'/g" c:\LAFDCWEB_pre-02.TXT > c:\LAFDCWEB_pre-03.txt
:C:\FOSS\GNU32\GetGnuWin32\bin\sed -r "s/$/'/g" c:\LAFDCWEB_pre-03.TXT > c:\LAFDCWEB_pre-04.txt

: LET'S SIMPLIFY ALL OF THIS

: CODE DRAFT #2

: LINE BODY TRANSFORM
:C:\FOSS\GNU32\GetGnuWin32\bin\sed "s/ $ /');('/g" c:\LAFDCWEB_pre-01.TXT > c:\LAFDCWEB_pre-02.txt
: LINE TAIL TRANSFORM
:C:\FOSS\GNU32\GetGnuWin32\bin\sed "s/$/')/g" c:\LAFDCWEB_pre-02.TXT > c:\LAFDCWEB_pre-03.txt
: LINE HEAD TRANSFORM
:C:\FOSS\GNU32\GetGnuWin32\bin\sed "s/^/('/g" c:\LAFDCWEB_pre-03.TXT > c:\LAFDCWEB_pre-04.txt

: CODE DRAFT #3

: REMOVE SINGLE QUOTES FROM LINES (REPLACE WITH SPACE)
C:\FOSS\GNU32\GetGnuWin32\bin\sed "s/'/ /g" "LAFDC_EXPORT.TXT" > "LAFDCWEB_pre-01.TXT"

: LINE BODY TRANSFORM -> turn them into insert statements
C:\FOSS\GNU32\GetGnuWin32\bin\sed "s/ $ /','/g" LAFDCWEB_pre-01.TXT > LAFDCWEB_pre-02.TXT
: LINE HEAD TRANSFORM
C:\FOSS\GNU32\GetGnuWin32\bin\sed "s/^/INSERT ROUTAGE_IMPORT values ('/g" LAFDCWEB_pre-02.TXT > LAFDCWEB_pre-03.TXT
: LINE TAIL TRANSFORM
C:\FOSS\GNU32\GetGnuWin32\bin\sed "s/$/')/g" LAFDCWEB_pre-03.TXT > LAFDCWEB_IMPORT.SQL

del LAFDCWEB_pre-01.TXT
del LAFDCWEB_pre-02.TXT
del LAFDCWEB_pre-03.TXT